using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._RasterAnalysisTools._UseProximity
{
    /// <summary>
    /// <para>Cost Path As Polyline</para>
    /// <para>Calculates the least-cost path from a source to a destination as a line feature.</para>
    /// <para>将从源到目标的开销最低路径计算为线要素。</para>
    /// </summary>    
    [DisplayName("Cost Path As Polyline")]
    public class CostPathAsPolyline : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public CostPathAsPolyline()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputDestinationRasterOrFeatures">
        /// <para>Input Destination Raster or Features</para>
        /// <para><xdoc>
        ///   <para>An image service or feature service that identifies those locations from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is an image service, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务或要素服务，用于标识从中确定成本最低路径到成本最低源的位置。</para>
        ///   <para>如果输入是影像服务，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_inputCostDistanceRaster">
        /// <para>Input Cost Distance or Euclidean Distance Raster</para>
        /// <para>The cost distance or Euclidean distance raster to be used to determine the least-cost path from the sources to the destinations.</para>
        /// <para>成本距离或欧几里得距离栅格，用于确定从源到目标的最低成本路径。</para>
        /// </param>
        /// <param name="_inputCostBacklinkRaster">
        /// <para>Input Cost Backlink, Back Direction or Flow Direction Raster</para>
        /// <para><xdoc>
        ///   <para>The name of the raster used to determine the path to return to a source via the least-cost path or the shortest path.</para>
        ///   <para>For each cell in the back link or direction raster, a value identifies the neighbor that is the next cell on the path from the cell to a source cell.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定通过开销最低路径或最短路径返回源的路径的栅格的名称。</para>
        ///   <para>对于反向链接或方向栅格中的每个像元，一个值用于标识从像元到源像元的路径上的下一个像元的邻居。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_outputPolylineName">
        /// <para>Output Polyline Name</para>
        /// <para>The output feature service that will contain the least cost path.</para>
        /// <para>将包含成本最低路径的输出要素服务。</para>
        /// </param>
        public CostPathAsPolyline(object _inputDestinationRasterOrFeatures, object _inputCostDistanceRaster, object _inputCostBacklinkRaster, object _outputPolylineName)
        {
            this._inputDestinationRasterOrFeatures = _inputDestinationRasterOrFeatures;
            this._inputCostDistanceRaster = _inputCostDistanceRaster;
            this._inputCostBacklinkRaster = _inputCostBacklinkRaster;
            this._outputPolylineName = _outputPolylineName;
        }
        public override string ToolboxName => "Raster Analysis Tools";

        public override string ToolName => "Cost Path As Polyline";

        public override string CallName => "ra.CostPathAsPolyline";

        public override List<string> AcceptEnvironments => ["outputCoordinateSystem"];

        public override object[] ParameterInfo => [_inputDestinationRasterOrFeatures, _inputCostDistanceRaster, _inputCostBacklinkRaster, _outputPolylineName, _pathType.GetGPValue(), _destinationField, _outputPolylineFeatures];

        /// <summary>
        /// <para>Input Destination Raster or Features</para>
        /// <para><xdoc>
        ///   <para>An image service or feature service that identifies those locations from which the least-cost path is determined to the least costly source.</para>
        ///   <para>If the input is an image service, the input consists of cells that have valid values (zero is a valid value), and the remaining cells must be assigned NoData.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>一种影像服务或要素服务，用于标识从中确定成本最低路径到成本最低源的位置。</para>
        ///   <para>如果输入是影像服务，则输入由具有有效值的像元组成（零为有效值），并且必须为其余像元分配 NoData。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Destination Raster or Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputDestinationRasterOrFeatures { get; set; }


        /// <summary>
        /// <para>Input Cost Distance or Euclidean Distance Raster</para>
        /// <para>The cost distance or Euclidean distance raster to be used to determine the least-cost path from the sources to the destinations.</para>
        /// <para>成本距离或欧几里得距离栅格，用于确定从源到目标的最低成本路径。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cost Distance or Euclidean Distance Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputCostDistanceRaster { get; set; }


        /// <summary>
        /// <para>Input Cost Backlink, Back Direction or Flow Direction Raster</para>
        /// <para><xdoc>
        ///   <para>The name of the raster used to determine the path to return to a source via the least-cost path or the shortest path.</para>
        ///   <para>For each cell in the back link or direction raster, a value identifies the neighbor that is the next cell on the path from the cell to a source cell.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于确定通过开销最低路径或最短路径返回源的路径的栅格的名称。</para>
        ///   <para>对于反向链接或方向栅格中的每个像元，一个值用于标识从像元到源像元的路径上的下一个像元的邻居。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Cost Backlink, Back Direction or Flow Direction Raster")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputCostBacklinkRaster { get; set; }


        /// <summary>
        /// <para>Output Polyline Name</para>
        /// <para>The output feature service that will contain the least cost path.</para>
        /// <para>将包含成本最低路径的输出要素服务。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Polyline Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputPolylineName { get; set; }


        /// <summary>
        /// <para>Path type</para>
        /// <para><xdoc>
        ///   <para>Specifies the manner in which the values and zones on the input destination data will be interpreted in the cost path calculations.</para>
        ///   <bulletList>
        ///     <bullet_item>Best single—For all cells on the input destination data, the least-cost path will be derived from the cell with the minimum of the least-cost paths to source cells.</bullet_item><para/>
        ///     <bullet_item>Each zone—For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone will begin at the cell with the lowest cost distance weighting in the zone.</bullet_item><para/>
        ///     <bullet_item>Each cell—For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data will be treated separately, and a least-cost path will be determined for each from cell.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在成本路径计算中解释输入目标数据的值和区域的方式。</para>
        ///   <bulletList>
        ///     <bullet_item>最佳单像元 - 对于输入目标数据上的所有像元，将从具有到源像元的最小开销路径的像元派生出成本最低的像元。</bullet_item><para/>
        ///     <bullet_item>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径将从该区域中成本距离加权最低的像元开始。</bullet_item><para/>
        ///     <bullet_item>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个从单元格确定成本最低的路径。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Path type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _pathType_value _pathType { get; set; } = _pathType_value._BEST_SINGLE;

        public enum _pathType_value
        {
            /// <summary>
            /// <para>Each cell</para>
            /// <para>Each cell—For each cell with valid values on the input destination data, a least-cost path is determined and saved on the output raster. With this option, each cell of the input destination data will be treated separately, and a least-cost path will be determined for each from cell.</para>
            /// <para>每个像元 - 对于输入目标数据上具有有效值的每个像元，将确定成本最低的路径并将其保存在输出栅格上。使用此选项，将单独处理输入目标数据的每个单元格，并为每个从单元格确定成本最低的路径。</para>
            /// </summary>
            [Description("Each cell")]
            [GPEnumValue("EACH_CELL")]
            _EACH_CELL,

            /// <summary>
            /// <para>Each zone</para>
            /// <para>Each zone—For each zone on the input destination data, a least-cost path is determined and saved on the output raster. With this option, the least-cost path for each zone will begin at the cell with the lowest cost distance weighting in the zone.</para>
            /// <para>每个区域 - 对于输入目标数据上的每个区域，将确定一条成本最低的路径并将其保存在输出栅格上。使用此选项时，每个区域的最低成本路径将从该区域中成本距离加权最低的像元开始。</para>
            /// </summary>
            [Description("Each zone")]
            [GPEnumValue("EACH_ZONE")]
            _EACH_ZONE,

            /// <summary>
            /// <para>Best single</para>
            /// <para>Best single—For all cells on the input destination data, the least-cost path will be derived from the cell with the minimum of the least-cost paths to source cells.</para>
            /// <para>最佳单像元 - 对于输入目标数据上的所有像元，将从具有到源像元的最小开销路径的像元派生出成本最低的像元。</para>
            /// </summary>
            [Description("Best single")]
            [GPEnumValue("BEST_SINGLE")]
            _BEST_SINGLE,

        }

        /// <summary>
        /// <para>Destination Field</para>
        /// <para>The field that will be used to obtain values for the destination locations.</para>
        /// <para>将用于获取目标位置值的字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destinationField { get; set; } = null;


        /// <summary>
        /// <para>Output Polyline Feature</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Polyline Feature")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _outputPolylineFeatures { get; set; }


        public CostPathAsPolyline SetEnv(object outputCoordinateSystem = null)
        {
            base.SetEnv(outputCoordinateSystem: outputCoordinateSystem);
            return this;
        }

    }

}